Conversation
When the EditorView is re-created (e.g. toggling editable) while the side menu is visible, a queued floating-ui scroll callback can fire after view.state has been cleared, causing a TypeError. Use optional chaining so the early return covers that case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughA defensive programming fix to the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
Summary
Fixes #2694.
SideMenuExtension.hideMenuIfNotFrozenwas throwingTypeError: Cannot read properties of undefined (reading 'show')when a queued floating-ui scroll callback fired after the underlyingEditorViewhad been re-created (e.g. togglingeditable).Rationale
The plugin's
view.statemay already have not been initialized whilehideMenuIfNotFrozenis still called in some sort of race condition.A larger revisit of the side menu is planned — this is the minimal fix to stop the production noise for now.
Changes
view.state?.showinstead ofview.state!.showin the freshness guard.Impact
No behavior change on the happy path; only suppresses the error when the view has been torn down.
Testing
x
Checklist
Additional Notes
Quick fix ahead of a broader side-menu revisit.
Summary by CodeRabbit